<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<%@ include file="/WEB-INF/views/include/head.jsp"%>
<link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
<link rel="stylesheet" href="${ctxStatic}/css/list.css">
<script type="text/javascript">
	$(document).ready(function(){
		searchListForm();
	});

	// 查询实装方法
	function searchListForm() {
		var searchParam = $("#itemNameCn").val();
		$("#activity_pane").showLoading();
		$.post("${ctx}/material/category/searchList?itemNameCn="+searchParam, "", function(result) {
			var listHtml = result["category"];
			var pageHtml = result["page"];
			$("#listHtml").html(listHtml);
			$("#paging").html(pageHtml);
			$("#activity_pane").hideLoading();
		}, 'json');
	}

	// 重置
	function clean() {
		$("input").val("");
		searchListForm();
	}
	
    $(document).keydown(function(event){
    	if(event.keyCode == 13){
    		searchListForm();
    	}
    });
</script>
</head>
<body>
	<div class="listArea" id="activity_pane" >
		<form id="searchForm" method="post">
			<div class="listBg" >
				<div class="searchArea clearfix">
					<div class="searchLeft clearfix">
						<div class="searchInp clearfix">
							<p>
								<spring:message code="category_itemNameCn" />
							</p>
							<input type="text" class="w-styleNub" id="itemNameCn" name="itemNameCn" value="${category.itemNameCn}">
						</div>
					</div>
					<div class="searchRight clearfix" id="subItem">
                        <!-- 查询 -->
						<button type="button" class="btn-js" onclick="searchListForm();">
							<spring:message code="commom_check" />
						</button>
   						<!-- 重置 -->
						<button type="button" class="btn-js" onclick="clean();">
							<spring:message code="category_reset" />
						</button>
						<!-- 创建 -->
						<shiro:hasPermission name="material:category:edit">
							<button type="button" class="btn-cj"
								onclick="popup('900px','584px','${ctx}/material/category/form')">
								<spring:message code="category_create" />
							</button>
						</shiro:hasPermission>
					</div>
				</div>
				<div class="tableArea">
				<div class="tableScrollSm" style="overflow: auto;width: 1293px;height: 714px; ">
						<table cellpadding="0" class="tableHead">
							<thead>
								<tr>
									<th><p class="table-No">
											<spring:message code="common_no" />
										</p></th>
									<th><p class="table-xmCD">
											<spring:message code="category_code" />
										</p></th>
									<th><p class="table-zwmc">
											<spring:message code="category_Cn" />
										</p></th>
									<th><p class="table-ywmc">
											<spring:message code="category_En" />
										</p></th>
									<th><p class="table-zt">
											<spring:message code="category_state" />
										</p></th>
									<th><p class="table-ms">
											<spring:message code="category_remarks" />
										</p></th>
									<th><p class="table-cjz">
											<spring:message code="category_creater" />
										</p></th>
									<th><p class="table-rq">
											<spring:message code="category_createDate" />
										</p></th>
								</tr>
							</thead>
						</table>
	                    <table cellpadding="0" class="tableBody">
						    <tbody  id = "listHtml"></tbody>	
	                	</table>
					</div>
				</div>
			</div>
			<div id = "paging" ></div>
		</form>
	</div>
</body>
</html>